import pytest
from Common.driver_util import DriverUtils, DriverType


@pytest.fixture(scope='session')
def setup_teardown():
    driver = DriverUtils().get_driver(DriverType.SELENIUM)
    yield driver
    DriverUtils.quit_driver()


@pytest.fixture(scope='function', autouse=True)
def go_index(setup_teardown):
    driver = setup_teardown
    driver.get('http://www.lagoushop.com/')
    yield
    # 这里可以添加清理操作，例如回到初始页面等
    driver.back()